package com.wwtech.epp.ui.activity.work.module;

import com.wwtech.epp.data.api.HttpAPIWrapper;
import com.wwtech.epp.ui.activity.base.ActivityScope;
import com.wwtech.epp.ui.activity.work.LeaveActivity;
import com.wwtech.epp.ui.activity.work.contract.LeaveContract;
import com.wwtech.epp.ui.activity.work.presenter.LeavePresenter;

import dagger.Module;
import dagger.Provides;

/**
 * @author hzp
 * @Package com.wwtech.epp.ui.activity.work
 * @Description: The moduele of LeaveActivity, provide field for LeaveActivity
 * @date 2017/08/31 22:20:02
 */
@Module
public class LeaveModule {
    private final LeaveContract.View mView;


    public LeaveModule(LeaveContract.View view) {
        this.mView = view;
    }

    @Provides
    @ActivityScope
    public LeavePresenter provideLeavePresenter(HttpAPIWrapper httpAPIWrapper, LeaveActivity mActivity) {
        return new LeavePresenter(httpAPIWrapper, mView, mActivity);
    }

    @Provides
    @ActivityScope
    public LeaveActivity provideLeaveActivity() {
        return (LeaveActivity) mView;
    }
}